import 'package:flutter/material.dart';
import 'package:rebase_project/res/colors.dart';
import 'package:rebase_project/res/style.dart';
import 'package:caose/caose.dart' show dip,sp;
import 'Button.dart';
import 'ScaleButton.dart';

class HFErrorWidget extends StatelessWidget {
  final VoidCallback callback;

  const HFErrorWidget({Key key, this.callback}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Image.asset("images/main/error_network.png"),
          Padding(
            padding: EdgeInsets.only(top: dip(40)),
            child: Text(
              "网络不给力，请重新加载",
              style: text_999_15,
            ),
          ),
          Padding(
              padding: EdgeInsets.only(top: dip(60)),
              child: ScaleButton(
                child: Container(
                  width: dip(160),
                  height: dip(40),
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      borderRadius: rCircular,
                      border: Border.all(
                        color: cff5663,
                      )),
                  child: Text(
                    "重新加载",
                    style: text_red_16,
                  ),
                ),
                onPressed: callback,
              ))
        ],
      ),
    );
  }
}
